<?php

declare(strict_types=1);

namespace Modules\Base\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $code
 * @property $days
 * @property $active
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
*/
class BoxNumber extends Model
{

    protected $table = 'box_number';

    protected $fillable = [ 'id', 'img','code','box_type', 'days', 'active','from','org_code','docid','docno','material_no', 'creator_id', 'created_at', 'updated_at', 'deleted_at' ];

    /**
     * @var array
     */
    protected array $fields = ['id','img','code','box_type','days','active','from','org_code','docid','docno','material_no','created_at','updated_at'];

    /**
     * @var array
     */
    protected array $form = ['code','box_type','img','days','from','org_code','docid','docno','material_no','active'];

    /**
     * @var array
     */
    public array $searchable = [
        'code'      => 'like',
        'box_type'  => '=',
        'active'    => '=',

    ];
    /**
     * 时间格式化
     * @param $date
     * @return mixed
     */
    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i');
    }


}
